﻿<%@ Page Title="Matriz Curricular" Language="C#" MasterPageFile="~/Site.Master"
    AutoEventWireup="true" CodeBehind="CadastroMatrizCurricular.aspx.cs" Inherits="AcadPosApp.Cadastros.CadastroMatrizCurricular" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 1390px;
        }
        .style4
        {
            width: 300px;
            height: 38px;
        }
        .style6
        {
            height: 38px;
        }
        .style20
        {
            width: 150px;
        }
        .style22
        {
            width: 314px;
            height: 45px;
        }
        .style23
        {
            height: 45px;
        }
        .style25
        {
            width: 168px;
        }
        .style27
        {
            height: 30px;
            width: 308px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnlPesquisa" runat="server" GroupingText="Consulta de Cursos">
                <table class="form-inline">
                    <tr>
                        <td class="style27">
                            Áreas de Conhecimento<br />
                            <asp:DropDownList ID="ddlAreaConhecimento" runat="server" AutoPostBack="True" 
                                OnSelectedIndexChanged="ddlAreaConhecimento_SelectedIndexChanged" Width="300px">
                            </asp:DropDownList>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="style27">
                            Descrição<br />
                            <asp:TextBox ID="txtPesquisa" runat="server" MaxLength="250" Width="300px" 
                                required="required"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;
                            <br />
                            <asp:Button ID="btnConsultar" runat="server" OnClick="btnConsultar_Click" 
                                Text="Consultar" ValidationGroup="pesquisa" Width="100px" />
                        </td>
                    </tr>  
                    <caption>
                        <br />
                    </caption>
                </table>
                <asp:GridView ID="gvwPesquisa" runat="server" AutoGenerateColumns="False" CssClass="mGrid"
                    DataKeyNames="ID_CURSO" EmptyDataText="Dados não localizados..." GridLines="Vertical"
                    Width="45%" OnRowDataBound="gvwPesquisa_RowDataBound" AllowPaging="True" OnPageIndexChanging="gvwPesquisa_PageIndexChanging"
                    OnSelectedIndexChanged="gvwPesquisa_SelectedIndexChanged">
                    <AlternatingRowStyle BackColor="#D3D3D3" />
                    <Columns>
                        <asp:CommandField ButtonType="Image" SelectImageUrl="~/Imagens/select.png" ShowSelectButton="True">
                            <ItemStyle Width="1%" />
                        </asp:CommandField>
                        <asp:BoundField DataField="ID_CURSO" HeaderText="Código">
                            <HeaderStyle HorizontalAlign="Center" Width="1%" />
                            <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DESCRICAO" HeaderText="Cursos">
                            <ItemStyle HorizontalAlign="Left" Width="75%" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Status">
                            <ItemTemplate>
                                <asp:Image ID="imgStatus" runat="server" Height="25px" Width="25px" />
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Width="1%" />
                            <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="SITUACAO" HeaderText="Situação">
                            <ItemStyle Width="10%" HorizontalAlign="Center" />
                        </asp:BoundField>
                    </Columns>
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#808080" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#383838" />
                </asp:GridView>
                <br />
                <table class="style1">
                    <tr>
                        <td class="style2">
                            Currículo<br />
                            <asp:DropDownList ID="ddlCurriculoPesquisa" runat="server" AutoPostBack="True" 
                                Enabled="false" 
                                OnSelectedIndexChanged="ddlCurriculoPesquisa_SelectedIndexChanged" 
                                Width="300px">
                            </asp:DropDownList>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
                <table class="style1">
                    <tr>
                        <td class="style4">
                            Módulo<br />
                            <asp:DropDownList ID="ddlModuloPesquisa" runat="server" AutoPostBack="True" 
                                Enabled="False" OnSelectedIndexChanged="ddlModuloPesquisa_SelectedIndexChanged" 
                                Width="300px">
                            </asp:DropDownList>
                        </td>
                        <td class="style6">
                            <br />
                            &nbsp;&nbsp;
                            <asp:Button ID="btnConsultarDisciplinas" runat="server" 
                                OnClick="btnConsultarDisciplinas_Click" Text="Consultar" Width="100px" />
                        </td>
                    </tr>
                </table>
                <br />
                
            </asp:Panel>         
            <br />
            <asp:Panel ID="pnlPesquisaDisciplinas" runat="server" GroupingText="Disciplinas do Módulo"
                    Visible="False">
                    <asp:GridView ID="gvwPesquisaDisciplinas" runat="server" AutoGenerateColumns="False"
                        CssClass="mGrid" DataKeyNames="ID_MATRIZ_CURRICULAR, ID_DISCIPLINA, ID_MODULO_CURRICULO"
                        EmptyDataText="Dados não localizados..." GridLines="Vertical" OnRowCommand="gvwPesquisaDisciplinas_RowCommand"
                        Width="45%" OnRowCreated="gvwPesquisaDisciplinas_RowCreated" OnRowDataBound="gvwPesquisaDisciplinas_RowDataBound"
                        AllowPaging="True" 
                        OnPageIndexChanging="gvwPesquisaDisciplinas_PageIndexChanging">
                        <AlternatingRowStyle BackColor="#D3D3D3" />
                        <Columns>
                            <%--<asp:ButtonField ButtonType="Image" CommandName="Alterar" ImageUrl="~/Imagens/edit.png"
                    Text="Button" HeaderText="Alterar" >
                    <ItemStyle  Width="20px"/>
                    </asp:ButtonField>  --%>
                            <asp:TemplateField HeaderText="Editar" ShowHeader="False">
                                <ItemTemplate>
                                    <abbr>
                                        <asp:ImageButton ID="ImgAlterar" runat="server" CausesValidation="false" CommandName="Alterar"
                                            formnovalidate="formnovalidate" ImageUrl="~/Imagens/edit.png" Text="Alterar"
                                            Width="20px" />
                                    </abbr>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" Width="1%" />
                                <ItemStyle HorizontalAlign="Center" Width="1%" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Excluir" ShowHeader="False">
                                <ItemTemplate>
                                    <abbr title="Excluir">
                                        <asp:ImageButton ID="Excluir" formnovalidate="formnovalidate" runat="server" CausesValidation="false"
                                            OnClientClick="return ShowConfirm('Tem certeza que deseja excluir?', this.ID);"
                                            CommandName="Excluir" ImageUrl="~/Imagens/delete.png" Text="Excluir" Width="20px" />
                                    </abbr>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" Width="1%" />
                                <ItemStyle HorizontalAlign="Center" Width="1%" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="ORDEM_MINISTRACAO" HeaderText="Ordem">
                                <HeaderStyle HorizontalAlign="Center" Width="1%" />
                                <ItemStyle HorizontalAlign="Center" Width="1%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="DESCRICAO_DISCIPLINA" HeaderText="Disciplina">
                                <HeaderStyle HorizontalAlign="Center" Width="80%" />
                                <ItemStyle HorizontalAlign="Left" Width="80%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="CH_DISCIPLINA" HeaderText="C.H.">
                                <HeaderStyle HorizontalAlign="Center" Width="10%" />
                                <ItemStyle HorizontalAlign="Left" Width="10%" />
                            </asp:BoundField>
                        </Columns>
                        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                        <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
                        <SortedAscendingCellStyle BackColor="#F1F1F1" />
                        <SortedAscendingHeaderStyle BackColor="#808080" />
                        <SortedDescendingCellStyle BackColor="#CAC9C9" />
                        <SortedDescendingHeaderStyle BackColor="#383838" />
                    </asp:GridView>
                    <br />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnInserir" runat="server" formnovalidate="formnovalidate" 
                        OnClick="btnInserir_Click" Text="Inserir" Width="100px" />
                    <br />
                    <br />
                    <div class="legenda">
                              <asp:Panel ID="pnlImpressao" runat="server" GroupingText="Impressão" 
                        Visible="False" Width="30%">
                        <div class="col-md-6">
                            <asp:RadioButtonList ID="rblTipoRel" runat="server" AutoPostBack="True">
                                <asp:ListItem Selected="True">Matriz Curricular</asp:ListItem>
                                <asp:ListItem>Ementas Completo</asp:ListItem>
                                <asp:ListItem>Ementas Simples</asp:ListItem>
                            </asp:RadioButtonList>
                        </div>
                        <div class="col-md-6">
                            <div align="center">
                                <br />
                                <asp:ImageButton ID="ImgImprimir" runat="server" ImageUrl="~/Imagens/print.png" 
                                    OnClick="ImgImprimir_Click" />
                            </div>
                        </div>
                        <br />
                    </asp:Panel>
                    </div>
                    </asp:Panel>
            <br />
            <asp:Panel ID="pnlCadastro" runat="server" GroupingText="Cadastro de Disciplinas no Módulo"
                Visible="False">
                <table class="style1">
                    <tr>
                        <td class="style22">
                            Descrição<br />
                            <asp:TextBox ID="txtCadPesqDisciplinas" runat="server" MaxLength="100" 
                                Width="300px"></asp:TextBox>
                        </td>
                        <td class="style23">
                            <br />
                            <asp:Button ID="btnConsultarDisciplinasCadastro" runat="server" 
                                formnovalidate="formnovalidate" OnClick="btnConsultarDisciplinasCadastro_Click" 
                                Text="Consultar" ValidationGroup="pesquisaDisciplinas" Width="100px" />
                        </td>
                    </tr>
                </table>
                <asp:GridView ID="gvwDisciplinasCadastro" runat="server" AutoGenerateColumns="False"
                    CssClass="mGrid" DataKeyNames="ID_DISCIPLINA" EmptyDataText="Dados não localizados..."
                    GridLines="Vertical" Width="45%" AllowPaging="True" 
                    OnPageIndexChanging="gvwDisciplinasCadastro_PageIndexChanging">
                    <AlternatingRowStyle BackColor="#D3D3D3" />
                    <Columns>
                        <asp:CommandField ButtonType="Image" SelectImageUrl="~/Imagens/select.png" ShowSelectButton="True">
                            <ItemStyle Width="1%" />
                        </asp:CommandField>
                        <asp:BoundField DataField="DESCRICAO" HeaderText="Disciplina">
                            <ItemStyle HorizontalAlign="Left" Width="65%" />
                        </asp:BoundField>
                    </Columns>
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#808080" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#383838" />
                </asp:GridView>
                <table>
                    <tr>
                        <td class="style20">
                            Ordem Ministração<br />
                            <asp:TextBox ID="txtOrdemMinistracao" runat="server" MaxLength="3" 
                                pattern="[0-9]+$" required="" title="Somente números." Width="145px"></asp:TextBox>
                        </td>
                        <td class="style25">
                            C.H. Disciplina&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:TextBox ID="txtCargaHoraria" runat="server" MaxLength="3" 
                                pattern="[0-9]+$" required="" Width="145px" title="Somente números."></asp:TextBox>
                        </td>
                    </tr>
                </table>
                <table>
                    <tr>
                        <td colspan="4">
                            Ementa do Projeto&nbsp; &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <asp:TextBox ID="txtEmentaProjeto" MaxLength="500" required runat="server" Height="100px"
                                TextMode="MultiLine" Width="300px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            Ementa de Execução&nbsp; &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <asp:TextBox ID="txtEmentaExecucao" MaxLength="500" required runat="server" Height="100px"
                                TextMode="MultiLine" Width="300px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            Referências Bibliográficas&nbsp; &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <asp:TextBox ID="txtReferenciasBibliograficas" MaxLength="500" required runat="server"
                                Height="100px" TextMode="MultiLine" Width="300px"></asp:TextBox>
                        </td>
                    </tr>
                </table>
                <br />
                <div class="legenda">
                    <asp:Button ID="btnConfirmar" runat="server" Text="Confirmar" ValidationGroup="cadastro"
                        OnClick="btnConfirmar_Click" Width="100px" />
                    &nbsp;<asp:Button ID="btnCancelar" formnovalidate="formnovalidate" 
                        runat="server" Text="Cancelar"
                OnClick="btnCancelar_Click" Width="100px" />
                </div><br />
            </asp:Panel>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="ImgImprimir" />
        </Triggers>
    </asp:UpdatePanel>
    <asp:ValidationSummary ID="VSPesquisa" runat="server" ShowMessageBox="True" ShowSummary="False"
        ValidationGroup="pesquisa" />
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
        ShowSummary="False" ValidationGroup="pesquisaDisciplinas" />
</asp:Content>
